package jianzhiOffer;

public class Num009 {
    public int numSubarrayProductLessThanK(int[] nums, int k) {
        int count = 0;
        for(int i = 0; i < nums.length; i++) {
            int l = i;
            int r = l;
            int product = 1;
            while(r < nums.length) {
                product *= nums[r];
                r++;
                if(product < k) {
                    count++;
                }else {
                    break;
                }
            }
        }
        return count;
    }
}
